from rest_framework import serializers

from apps.goods.models import SPUSpecification, SPU, SpecificationOption


##########商品规格选项序列化器################
class OptionsSerializers(serializers.ModelSerializer):

    #关联嵌套返回 规格选项嵌套规格表返回
    spec = serializers.StringRelatedField(read_only=True)
    spec_id = serializers.IntegerField()

    class Meta:
        model = SpecificationOption
        fields = "__all__"


